# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1FeatureGroupBigQuery do
  @moduledoc """
  Input source type for BigQuery Tables and Views.

  ## Attributes

  *   `bigQuerySource` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1BigQuerySource.t`, *default:* `nil`) - Required. Immutable. The BigQuery source URI that points to either a BigQuery Table or View.
  *   `dense` (*type:* `boolean()`, *default:* `nil`) - Optional. If set, all feature values will be fetched from a single row per unique entityId including nulls. If not set, will collapse all rows for each unique entityId into a singe row with any non-null values if present, if no non-null values are present will sync null. ex: If source has schema `(entity_id, feature_timestamp, f0, f1)` and the following rows: `(e1, 2020-01-01T10:00:00.123Z, 10, 15)` `(e1, 2020-02-01T10:00:00.123Z, 20, null)` If dense is set, `(e1, 20, null)` is synced to online stores. If dense is not set, `(e1, 20, 15)` is synced to online stores.
  *   `entityIdColumns` (*type:* `list(String.t)`, *default:* `nil`) - Optional. Columns to construct entity_id / row keys. If not provided defaults to `entity_id`.
  *   `staticDataSource` (*type:* `boolean()`, *default:* `nil`) - Optional. Set if the data source is not a time-series.
  *   `timeSeries` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1FeatureGroupBigQueryTimeSeries.t`, *default:* `nil`) - Optional. If the source is a time-series source, this can be set to control how downstream sources (ex: FeatureView ) will treat time-series sources. If not set, will treat the source as a time-series source with `feature_timestamp` as timestamp column and no scan boundary.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :bigQuerySource =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1BigQuerySource.t() | nil,
          :dense => boolean() | nil,
          :entityIdColumns => list(String.t()) | nil,
          :staticDataSource => boolean() | nil,
          :timeSeries =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1FeatureGroupBigQueryTimeSeries.t()
            | nil
        }

  field(:bigQuerySource, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1BigQuerySource)
  field(:dense)
  field(:entityIdColumns, type: :list)
  field(:staticDataSource)

  field(:timeSeries,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1FeatureGroupBigQueryTimeSeries
  )
end

defimpl Poison.Decoder,
  for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1FeatureGroupBigQuery do
  def decode(value, options) do
    GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1FeatureGroupBigQuery.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1FeatureGroupBigQuery do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
